<template>
  <MkQueryContainer>
    <template #header>
      <MkForm ref="queryForm" :inline="true">
        <el-form-item label="关键字">
          <el-input @keyup.enter.native="search" v-model="searchParam.keyword" clearable />
        </el-form-item>
        <el-form-item>
          <MkButtonQuery @click="search"> </MkButtonQuery>
          <MkButtonAdd @click="add"></MkButtonAdd>
        </el-form-item>
      </MkForm>
    </template>
    <MkTable :data="tableData" v-loading="loading" @row-dblclick="edit">
      <MkColumnIndex />
      <MkColumn prop="mingCheng" label="名称" />
      <MkColumn prop="danWei" label="单位" />
      <MkColumn prop="xuanXiangShuZu" label="选项数组" />
      <MkColumn prop="canKaoFanWei" label="参考范围" />
      <MkColumn prop="lisDaiMa" label="Lis代码" />
      <MkColumn prop="lisMingCheng" label="Lis名称" />
      <MkColumn prop="shiFouBiTian" label="是否必填" />
      <MkColumn prop="gongShiDaiMa" label="公式代码" />
      <MkColumn prop="biTianGongShi" label="必填公式" />
      <MkColumn prop="shangXianGongShi" label="上限公式" />
      <MkColumn prop="xiaXianGongShi" label="下限公式" />
      <MkColumn prop="yangXingGongShi" label="阳性公式" />
      <MkColumn prop="orderNo" label="排序" />
      <MkColumn prop="remark" label="备注" />
      <MkColumnIsEnabled />
      <MkColumnOption @show="edit" :isMore="false" />
    </MkTable>
    <MkPagination v-model:page="searchParam.page" v-model:pageSize="searchParam.pageSize" :total="total"
      @query="search" />
    <EditPage ref="editPageRef" @query="search" />
  </MkQueryContainer>
</template>

<script lang='ts' setup name="BasShuXueJianYan">
// 血液品种资料
import { BasShuXueJianYanApi, BasShuXueJianYanOutput } from '/@/api/bas/BasShuXueJianYan';
import { usePageQuery } from '/@/hooks/usePageQuery'

import EditPage from './edit.vue'

const { searchParam, total, tableData, loading, search } = usePageQuery<BasShuXueJianYanOutput>(BasShuXueJianYanApi.page)

const editPageRef = ref();

onMounted(() => {
  search();
})

const add = () => {
  editPageRef.value.open();
}

const edit = (row: any) => {
  editPageRef.value.open(row);
}
</script>

<style lang='scss' scoped></style>